﻿using System;
using System.ComponentModel;
using System.Web.Mvc;
using Lyh.Core.Result;
using Lyh.Models;

namespace Lyh.Controllers
{
    public class MenuController : BaseController
    {
        [Description("获取树形菜单")]
        public ActionResult GetMenuTreeStore()
        {
            var menu = new MenuTreeStore
            {
                Id = Guid.NewGuid().ToString(),
                Text = "世界",
                Leaf = false,
                IconCls = "book",
                Url = "/Main/1"
            };
            var menu2 = new MenuTreeStore
            {
                Id = Guid.NewGuid().ToString(),
                Text = "Action",
                Leaf = true,
                IconCls = "book",
                Url = "/Action/Action"
            };
            var menu3 = new MenuTreeStore
            {
                Id = Guid.NewGuid().ToString(),
                Text = "Menu",
                Leaf = true,
                IconCls = "house",
                Url = "/"
            };
            menu.Children.Add(menu2);
            menu.Children.Add(menu3);
            return this.CustomJson(menu, false, true);
        }
    }
}
